//
//  InformationTableViewCell.m
//  Frame
//
//  Created by 这是工作本 on 16/2/19.
//  Copyright © 2016年 这是工作本. All rights reserved.
//

#import "InformationTableViewCell.h"

@interface InformationTableViewCell ()

@property (nonatomic, retain) UIImageView *imageV;

@property (nonatomic, retain) UILabel *title;

@property (nonatomic, retain) UILabel *introduce;

@property (nonatomic, retain) UIImageView *comment;

@property (nonatomic, retain) UILabel *number;
@end

@implementation InformationTableViewCell


- (void)data:(Homepage *)home
{
    [self.imageV sd_setImageWithURL:home.imageSrc placeholderImage:nil];
    self.title.text = home.title;
   self.introduce.text = home.descriptionHome;
    
    
}


- (instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        [self createSubview];
    }
    return self;
}


- (void)createSubview
{  //图片
    self.imageV = [[UIImageView alloc] initWithFrame:CGRectMake(5 * ScreenWidth, 5 * ScreenHeigth, 90 * ScreenWidth, 65 * ScreenHeigth)];
    [self.contentView addSubview:self.imageV];
    
    //标题
    
    self.title = [[UILabel alloc] initWithFrame:CGRectMake(self.imageV.frame.origin.x + self.imageV.frame.size.width + 22 * ScreenWidth, 5 * ScreenHeigth, 200 * ScreenWidth, 30)];
//    self.title.text = @"超级杯超级杯超级杯";
    self.title.textColor = [UIColor colorWithRed:30 / 255.0 green:30 / 255.0 blue:30 / 255.0 alpha:1.0];
    [self.contentView addSubview:self.title];
    
    
    //内容
    
    self.introduce = [[UILabel alloc] initWithFrame:CGRectMake(self.title.frame.origin.x, self.title.frame.origin.y + self.title.frame.size.height, 240 * ScreenWidth, 40 * ScreenHeigth)];
//    self.introduce.text = @"送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费停车卷送免费";
    self.introduce.textColor = [UIColor colorWithRed:150 / 255.0 green:150 /255.0 blue:150 / 255.0 alpha:1.0];
    self.introduce.numberOfLines = 0;
    self.introduce.font = [UIFont systemFontOfSize:13.0 * ScreenWidth];
    [self.contentView addSubview:self.introduce];

    
    //评论
    
    self.comment = [[UIImageView alloc] initWithFrame:CGRectMake(self.introduce.frame.origin.x + self.introduce.frame.size.width + 5 * ScreenWidth, 55 * ScreenHeigth,  14* ScreenWidth, 10 * ScreenHeigth)];
    self.comment.image = [UIImage imageNamed:@"111.png"];
    [self.contentView addSubview:self.comment];

    //评论人数
    
    self.number = [[UILabel alloc] initWithFrame:CGRectMake(self.comment.frame.origin.x + self.comment.frame.size.width + 5 * ScreenWidth, self.comment.frame.origin.y, 14 * ScreenWidth, 10 * ScreenHeigth)];
    self.number.text = @"50";
    self.number.font = [UIFont systemFontOfSize:11.0];
    self.number.textColor = [UIColor colorWithRed:150 / 255.0 green:150 / 255.0 blue:150 / 255.0 alpha:1.0];
    [self.contentView addSubview:self.number];

    
}



- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
